#ifndef __ACTOR_H_
#define __ACTOR_H_
#include "SDL2/SDL.h"
#include <iostream>
#include "SDL2/SDL_image.h"
#include <stdexcept>
#include <string>
#include "Actor.h"

using namespace std;

//小圆点
class Actor
{
    #define FRAME_COUNT 10
    #define ACTOR_HEIGHT 80
    #define ACTOR_WIDTH 80
private:
    //圆点的X，Y坐标
    int x, y;
    //圆点分别在X，Y方向上的速度分量
    int xVel, yVel;
    //圆点分别在X，Y方向上的速度分量
    void setClips();
    SDL_Rect clips[FRAME_COUNT];
    float nowFrameIndex;
    SDL_Texture *background = nullptr;

    SDL_Texture* LoadImage(SDL_Renderer *renderer, string file);

public:

    //初始化变量
    Actor();
    ~Actor();
    //接收键盘输入并改变圆点的速度
    void handleEvent(SDL_Event event);
    //溜圆点背景图
    void setBackground(SDL_Renderer *renderer, string filename);
    
    //显示原点
    void show(SDL_Renderer *renderer);
};

#endif //__ACTOR_H_